import router from '@system.router';
import prompt from '@system.prompt'
export default {
    data: {
        current: 0,
        avatar: "/common/images/moren.png",
        avatar1: "/common/images/people.png",
        addressname: "",
        addressphone: "",
        address: "",
        addresslist: [],
        len:0,
        addressList: [
            {
                id: 1,
                name: "鲁绣",
                phone: "121324324354",
                address: ["广东省", "广州市", "番禺区"],
                addDetail: " 沙湾世良路 1342号广州番禺职业技术学院",
            },
            {
                id: 2,
                name: "鲁绣",
                phone: "121324324354",
                address: ["广东省", "深圳市", "番禺区"],
                addDetail: " 沙湾世良路 1342号广州番禺职业技术学院",
            },
            {
                id: 3,
                name: "鲁绣",
                phone: "121324324354",
                address: ["广东省", "河源市", "番禺区"],
                addDetail: " 沙湾世良路 1342号广州番禺职业技术学院",
            },
            {
                id: 4,
                name: "鲁绣",
                phone: "121324324354",
                address: ["广东省", "广州市", "番禺区"],
                addDetail: " 沙湾世良路 1342号广州番禺职业技术学院",
            },
            {
                id: 5,
                name: "鲁绣",
                phone: "121324324354",
                address: ["广东省", "广州市", "番禺区"],
                addDetail: " 沙湾世良路 1342号广州番禺职业技术学院",
            },
            {
                id: 6,
                name: "鲁绣",
                phone: "121324324354",
                address: ["广东省", "广州市", "番禺区"],
                addDetail: " 沙湾世良路 1342号广州番禺职业技术学院",
            }
        ]
    },

    selectaddress(index) {
        this.current = index;
        this.addresslist.push(this.addressList[index]);

    },
    sure() {
        if ( this.addresslist.length>0) {
            console.log(this.addresslist[this.addresslist.length-1].name)
            router.push({
                uri: 'pages/ordersubmit/ordersubmit',
                params: {
                    addressname: this.addresslist[this.addresslist.length-1].name,
                    addressphone: this.addresslist[this.addresslist.length-1].phone,
                    address: this.addresslist[this.addresslist.length-1].address[0] + this.addresslist[this.addresslist.length-1].address[1] + this.addresslist[this.addresslist.length-1].address[2] + this.addresslist[this.addresslist.length-1].addDetail,
                }
            });
            this.addresslist = [];

        }

    },
}




//import router from '@system.router';
//import prompt from '@system.prompt';
//var info = null;
//
//export default {
//    data: {
//        current:0,
//        addressinfo:[{name:"55",phone:"566522",address:"云翔与"},
//                      {name:"5dfd5",phone:"566522",address:"云翔与"},
//                      {name:"5dfseg5",phone:"566522",address:"云翔与"},
//                      {name:"5dfbgte5",phone:"566522",address:"云翔与"}],
//        addressname:"",
//        addressphone:"",
//        address:"",
//        addresslist:[]
//    },
//    selectaddress(index){
//
//        this.current = index;
//        this.addresslist.push(this.addressinfo[index]);
//
//        if (this.addresslist.length==1) {
//
//           console.info(this.addresslist[0].name);
//            router.push({
//                uri:'pages/ordersubmit/ordersubmit',
//                params:{
//                    addressname:this.addresslist[0].name,
//                    addressphone:this.addresslist[0].phone,
//                    address:this.addresslist[0].address
//                }
//            });
//            this.addresslist=[];
//
//        }
//
//        //鸿蒙带参数跳转页面
////        router.push({
////            uri:'pages/ordersubmit/ordersubmit',
////            params:{
////                addresslists:this.addresslist
////            }
////        });
//    },
//
//
////    showhintDialog(e) {
////        this.$element('hintDialog').show()
////
////    },
////    sethintDialog(e) {
////        this.$element('hintDialog').close()
////    }
//    }
//
//
//
